Translation:

76. So he began (the search) with their baggage before (he came to) the baggage of his brother: at length He brought it out of his brother's baggage. Thus did We plan for Joseph. He could not take his brother by the law of the king except that Allah willed it (so). We raise to degrees (of wisdom) whom We please: but over all endued with knowledge is One the All-Knowing.

Notes (Tafseer)

1742. The pronoun "he" can only refer to Joseph. He may have been present all the time, or he may just have come up, as the supposed theft of the king's own cup (xii. 72 above) was a very serious and important affair, and the investigation required his personal supervision. All that his officers did by his orders was his own act. As the lawyers say: Qui facit per alium, facit per se (whoever does anything through another, does it himself).

1743. The Arabic word here used is wi'aun, plural au'iya, which includes bags, lockers, boxes, or any receptacles in which things are stored. Notice the appropriateness of the words used. The cup was concealed in a saddle-bag (rahl), verse 70 above. When it comes to searching, they must search all the baggage of every description if the search was to be convincing and effective.

1744. It refers to the drinking cup, the siqayat, which is a feminine noun: hence the feminine pronoun (ha) in Arabic.

1745. Let no one suppose that it was a vulgar or wicked trick, such as we sometimes hear of in police courts, when property is planted on innocent men to get them into trouble. On the contrary it was a device or stratagem whose purpose was to show up wickedness in its true colours, to give it a chance of repentance, to bring about forgiveness and reconciliation, to give solace to the aged father who had suffered so much. Joseph was a Prophet of Allah, but he could not have carried out his plan or taken the first step, of detaining his brother, except with the will and permission of Allah, Whose Plan is universal and for all His creatures.

1746. If we examine this world's affairs, there are all sorts of plans, and all degrees of folly and wisdom. The wicked ones plan; the foolish ones plan; the simple ones plan; then there are men who think themselves wise and are perhaps thought to be wise, but who are foolish, and they have their plans; and there are degrees of real and beneficent wisdom among men. Allah, is above all. Anything good in our wisdom is but a reflection of His wisdom, and His wisdom can even turn folly and wickedness to good.